ostbuild: Change to name-prefix and base-prefix in manifest
authorColin Walters <walters@verbum.org>
Wed, 7 Mar 2012 17:06:44 +0000 (12:06 -0500)
committerColin Walters <walters@verbum.org>
Tue, 13 Mar 2012 14:39:26 +0000 (10:39 -0400)
This makes it clearer that we're using this as a prefix, when we
generate the snapshots.

gnomeos/3.4/manifest.json
src/ostbuild/pyostbuild/buildutil.py
src/ostbuild/pyostbuild/builtin_build.py
src/ostbuild/pyostbuild/builtin_chroot_compile_one.py
src/ostbuild/pyostbuild/builtin_resolve.py

index 5a4b4ab9588d47d505ebf506390bb601ec8c89a4..4a3e8fb5b3c371a9a12af272fb5f85d7f4d74fc6 100644 (file)
@@ -1,7 +1,7 @@
 {
-  "name": "gnomeos-3.4",
+  "name-prefix": "gnomeos-3.4",
   "architectures": ["i686"],
-  "base": "yocto/gnomeos-3.4",
+  "base-prefix": "bases/yocto/gnomeos-3.4",
 
   "config-opts": ["--disable-static", "--disable-silent-rules"],
 
index e7cae93c7ce430e5f6f355a774bd688bf62211a6..79f0129fbcdbec14d2cee0fbc6292c4d72606334 100755 (executable)
@@ -83,9 +83,6 @@ def manifest_target(manifest):
         return name[:-len('-runtime')] + '-devel'
     return name
 
-def manifest_base(manifest):
-    return 'bases/%s' % (manifest['base'],)
-
 def manifest_buildname(manifest, component):
     return 'artifacts/%s/%s/%s' % (manifest_target(manifest),
                                    component['name'],
index 40f0bfba83acee0f2e42304a802a9c3b1d5ae985..7f1ca8d2205c417ffd2f6f4e07b63313efaf0982 100755 (executable)
@@ -188,7 +188,7 @@ class OstbuildBuild(builtins.Builtin):
         return True
 
     def _compose(self, components):
-        base_ref = 'bases/%s' % (self.manifest['base'], )
+        base_ref = self.manifest['base']
 
         # HACK
         manifest_build_name = self.manifest['name']
index f9dc4beab633fac8c452a7f0c6d197d1b0fb243e..fd0a35fcd43e43618ec9b054197f022cff86aae6 100755 (executable)
@@ -34,7 +34,7 @@ class OstbuildChrootCompileOne(builtins.Builtin):
         index = components.index(component)
         dependencies = components[:index]
 
-        base = 'bases/%s' % (self.manifest['base'], )
+        base = self.manifest['base']
         checkout_trees = [(base, '/')]
         for dep in dependencies:
             buildname = buildutil.manifest_buildname(self.manifest, dep)
index e7f5ece9576a32439a015cb6f4d1b136257a11c6..5018b49e6e8db2424ff3562abc42c3143d3eb88f 100755 (executable)
@@ -234,9 +234,13 @@ class OstbuildResolve(builtins.Builtin):
                 else:
                     snapshot['components'] = devel_components
 
-                snapshot['name'] = '%s-%s-%s' % (arch_manifest['name'], architecture, component_type)
-                snapshot_base = snapshot['base']
-                snapshot['base'] = snapshot_base + '-%s-%s' % (architecture, component_type)
+                name_prefix = snapshot['name-prefix']
+                del snapshot['name-prefix']
+                base_prefix = snapshot['base-prefix']
+                del snapshot['base-prefix']
+
+                snapshot['name'] = '%s-%s-%s' % (name_prefix, architecture, component_type)
+                snapshot['base'] = '%s-%s-%s' % (base_prefix, architecture, component_type)
                 out_snapshot = os.path.join(self.workdir, snapshot['name'] + '.snapshot')
                 f = open(out_snapshot, 'w')
                 json.dump(snapshot, f, indent=4, sort_keys=True)